package com.itcam.recursion;

/**
 * @author : Cammy.Wu
 * Description : 反向打印字符串
 */

public class Demo02rps {
    public static void main(String[] args) {
        String str = "nuyoah";
        reversePrint(str, 0);
    }

    private static void reversePrint(String str, int index) {
        if (index == str.length()) {
            return;
        }
        reversePrint(str, index + 1);
        System.out.print(str.charAt(index));
    }
}
